// +----------------------------------------------------------------------
// | CRMEB [ CRMEB赋能开发者，助力企业发展 ]
// +----------------------------------------------------------------------
// | Copyright (c) 2016~2021 https://www.crmeb.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed CRMEB并不是自由软件，未经许可不能去掉CRMEB相关版权
// +----------------------------------------------------------------------
// | Author: CRMEB Team <admin@crmeb.com>
// +----------------------------------------------------------------------

import request from '@/utils/request'

/**
 * 删除规则
 */
export function delRule(id) {
  return request({
    url: '/admin/rechargeConfig/delete?id=' + id,
    method: 'GET',
  })
}

/**
 * 获取规则
 */
export function getRuleList(params) {
  return request({
    url: '/admin/rechargeConfig/list?shopId=' + params.shopId,
    method: 'get',
  })
}

/**
 * 新增规则
 */
export function addRule(data) {
  return request({
    url: '/admin/rechargeConfig/save',
    method: 'post',
    data,
  })
}

/**
 * 更新规则--全部
 */
export function updateRule(data) {
  return request({
    url: '/admin/rechargeConfig/update',
    method: 'post',
    data,
  })
}

/**
 * 更新规则--状态
 */
export function updateStatus(params) {
  return request({
    url: '/admin/rechargeConfig/update/status',
    method: 'get',
    params,
  })
}
